(0) Obligation:

Runtime Complexity TRS:
The TRS R consists of the following rules:

p(0) → s(s(0))
p(s(x)) → x
p(p(s(x))) → p(x)
le(p(s(x)), x) → le(x, x)
le(0, y) → true
le(s(x), 0) → false
le(s(x), s(y)) → le(x, y)
minus(x, y) → if(le(x, y), x, y)
if(true, x, y) → 0
if(false, x, y) → s(minus(p(x), y))

Rewrite Strategy: INNERMOST

(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)

Converted CpxTRS to CDT

(2) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → s(s(0))
p(s(z0)) → z0
p(p(s(z0))) → p(z0)
le(p(s(z0)), z0) → le(z0, z0)
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, z1) → if(le(z0, z1), z0, z1)
if(true, z0, z1) → 0
if(false, z0, z1) → s(minus(p(z0), z1))
Tuples:

P(p(s(z0))) → c2(P(z0))
LE(p(s(z0)), z0) → c3(LE(z0, z0))
LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(z0, z1) → c7(IF(le(z0, z1), z0, z1), LE(z0, z1))
IF(false, z0, z1) → c9(MINUS(p(z0), z1), P(z0))
S tuples:

P(p(s(z0))) → c2(P(z0))
LE(p(s(z0)), z0) → c3(LE(z0, z0))
LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(z0, z1) → c7(IF(le(z0, z1), z0, z1), LE(z0, z1))
IF(false, z0, z1) → c9(MINUS(p(z0), z1), P(z0))
K tuples:none
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

P, LE, MINUS, IF

Compound Symbols:

c2, c3, c6, c7, c9

(3) CdtUnreachableProof (EQUIVALENT transformation)

The following tuples could be removed as they are not reachable from basic start terms:

P(p(s(z0))) → c2(P(z0))
LE(p(s(z0)), z0) → c3(LE(z0, z0))

(4) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → s(s(0))
p(s(z0)) → z0
p(p(s(z0))) → p(z0)
le(p(s(z0)), z0) → le(z0, z0)
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, z1) → if(le(z0, z1), z0, z1)
if(true, z0, z1) → 0
if(false, z0, z1) → s(minus(p(z0), z1))
Tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(z0, z1) → c7(IF(le(z0, z1), z0, z1), LE(z0, z1))
IF(false, z0, z1) → c9(MINUS(p(z0), z1), P(z0))
S tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(z0, z1) → c7(IF(le(z0, z1), z0, z1), LE(z0, z1))
IF(false, z0, z1) → c9(MINUS(p(z0), z1), P(z0))
K tuples:none
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, MINUS, IF

Compound Symbols:

c6, c7, c9

(5) CdtGraphRemoveTrailingProof (BOTH BOUNDS(ID, ID) transformation)

Removed 1 trailing tuple parts

(6) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → s(s(0))
p(s(z0)) → z0
p(p(s(z0))) → p(z0)
le(p(s(z0)), z0) → le(z0, z0)
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, z1) → if(le(z0, z1), z0, z1)
if(true, z0, z1) → 0
if(false, z0, z1) → s(minus(p(z0), z1))
Tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(z0, z1) → c7(IF(le(z0, z1), z0, z1), LE(z0, z1))
IF(false, z0, z1) → c9(MINUS(p(z0), z1))
S tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(z0, z1) → c7(IF(le(z0, z1), z0, z1), LE(z0, z1))
IF(false, z0, z1) → c9(MINUS(p(z0), z1))
K tuples:none
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, MINUS, IF

Compound Symbols:

c6, c7, c9

(7) CdtNarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Use narrowing to replace MINUS(z0, z1) → c7(IF(le(z0, z1), z0, z1), LE(z0, z1)) by

MINUS(0, z0) → c7(IF(true, 0, z0), LE(0, z0))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0), LE(s(z0), 0))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))

(8) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → s(s(0))
p(s(z0)) → z0
p(p(s(z0))) → p(z0)
le(p(s(z0)), z0) → le(z0, z0)
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, z1) → if(le(z0, z1), z0, z1)
if(true, z0, z1) → 0
if(false, z0, z1) → s(minus(p(z0), z1))
Tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
IF(false, z0, z1) → c9(MINUS(p(z0), z1))
MINUS(0, z0) → c7(IF(true, 0, z0), LE(0, z0))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0), LE(s(z0), 0))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
S tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
IF(false, z0, z1) → c9(MINUS(p(z0), z1))
MINUS(0, z0) → c7(IF(true, 0, z0), LE(0, z0))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0), LE(s(z0), 0))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
K tuples:none
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, IF, MINUS

Compound Symbols:

c6, c9, c7

(9) CdtGraphRemoveDanglingProof (ComplexityIfPolyImplication transformation)

Removed 1 of 5 dangling nodes:

MINUS(0, z0) → c7(IF(true, 0, z0), LE(0, z0))

(10) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → s(s(0))
p(s(z0)) → z0
p(p(s(z0))) → p(z0)
le(p(s(z0)), z0) → le(z0, z0)
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, z1) → if(le(z0, z1), z0, z1)
if(true, z0, z1) → 0
if(false, z0, z1) → s(minus(p(z0), z1))
Tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
IF(false, z0, z1) → c9(MINUS(p(z0), z1))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0), LE(s(z0), 0))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
S tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
IF(false, z0, z1) → c9(MINUS(p(z0), z1))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0), LE(s(z0), 0))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
K tuples:none
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, IF, MINUS

Compound Symbols:

c6, c9, c7

(11) CdtGraphRemoveTrailingProof (BOTH BOUNDS(ID, ID) transformation)

Removed 1 trailing tuple parts

(12) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → s(s(0))
p(s(z0)) → z0
p(p(s(z0))) → p(z0)
le(p(s(z0)), z0) → le(z0, z0)
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, z1) → if(le(z0, z1), z0, z1)
if(true, z0, z1) → 0
if(false, z0, z1) → s(minus(p(z0), z1))
Tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
IF(false, z0, z1) → c9(MINUS(p(z0), z1))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
S tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
IF(false, z0, z1) → c9(MINUS(p(z0), z1))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
K tuples:none
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, IF, MINUS

Compound Symbols:

c6, c9, c7, c7

(13) CdtNarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Use narrowing to replace IF(false, z0, z1) → c9(MINUS(p(z0), z1)) by

IF(false, 0, x1) → c9(MINUS(s(s(0)), x1))
IF(false, s(z0), x1) → c9(MINUS(z0, x1))

(14) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → s(s(0))
p(s(z0)) → z0
p(p(s(z0))) → p(z0)
le(p(s(z0)), z0) → le(z0, z0)
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, z1) → if(le(z0, z1), z0, z1)
if(true, z0, z1) → 0
if(false, z0, z1) → s(minus(p(z0), z1))
Tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
IF(false, 0, x1) → c9(MINUS(s(s(0)), x1))
IF(false, s(z0), x1) → c9(MINUS(z0, x1))
S tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
IF(false, 0, x1) → c9(MINUS(s(s(0)), x1))
IF(false, s(z0), x1) → c9(MINUS(z0, x1))
K tuples:none
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, MINUS, IF

Compound Symbols:

c6, c7, c7, c9

(15) CdtGraphRemoveDanglingProof (BOTH BOUNDS(ID, ID) transformation)

Removed 1 of 5 dangling nodes:

IF(false, 0, x1) → c9(MINUS(s(s(0)), x1))

(16) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → s(s(0))
p(s(z0)) → z0
p(p(s(z0))) → p(z0)
le(p(s(z0)), z0) → le(z0, z0)
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, z1) → if(le(z0, z1), z0, z1)
if(true, z0, z1) → 0
if(false, z0, z1) → s(minus(p(z0), z1))
Tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
IF(false, s(z0), x1) → c9(MINUS(z0, x1))
S tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
IF(false, s(z0), x1) → c9(MINUS(z0, x1))
K tuples:none
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, MINUS, IF

Compound Symbols:

c6, c7, c7, c9

(17) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^1))) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

IF(false, s(z0), x1) → c9(MINUS(z0, x1))
We considered the (Usable) Rules:

le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
And the Tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
IF(false, s(z0), x1) → c9(MINUS(z0, x1))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0   
POL(IF(x1, x2, x3)) = x2   
POL(LE(x1, x2)) = 0   
POL(MINUS(x1, x2)) = x1   
POL(c6(x1)) = x1   
POL(c7(x1)) = x1   
POL(c7(x1, x2)) = x1 + x2   
POL(c9(x1)) = x1   
POL(false) = 0   
POL(le(x1, x2)) = [3] + [4]x1 + [2]x2   
POL(s(x1)) = [2] + x1   
POL(true) = [2]   

(18) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → s(s(0))
p(s(z0)) → z0
p(p(s(z0))) → p(z0)
le(p(s(z0)), z0) → le(z0, z0)
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, z1) → if(le(z0, z1), z0, z1)
if(true, z0, z1) → 0
if(false, z0, z1) → s(minus(p(z0), z1))
Tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
IF(false, s(z0), x1) → c9(MINUS(z0, x1))
S tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
K tuples:

IF(false, s(z0), x1) → c9(MINUS(z0, x1))
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, MINUS, IF

Compound Symbols:

c6, c7, c7, c9

(19) CdtKnowledgeProof (EQUIVALENT transformation)

The following tuples could be moved from S to K by knowledge propagation:

MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
IF(false, s(z0), x1) → c9(MINUS(z0, x1))
IF(false, s(z0), x1) → c9(MINUS(z0, x1))

(20) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → s(s(0))
p(s(z0)) → z0
p(p(s(z0))) → p(z0)
le(p(s(z0)), z0) → le(z0, z0)
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, z1) → if(le(z0, z1), z0, z1)
if(true, z0, z1) → 0
if(false, z0, z1) → s(minus(p(z0), z1))
Tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
IF(false, s(z0), x1) → c9(MINUS(z0, x1))
S tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
K tuples:

IF(false, s(z0), x1) → c9(MINUS(z0, x1))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, MINUS, IF

Compound Symbols:

c6, c7, c7, c9

(21) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^2))) transformation)

Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.

LE(s(z0), s(z1)) → c6(LE(z0, z1))
We considered the (Usable) Rules:

le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
And the Tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
IF(false, s(z0), x1) → c9(MINUS(z0, x1))
The order we found is given by the following interpretation:
Polynomial interpretation :

POL(0) = 0   
POL(IF(x1, x2, x3)) = [2]x2·x3   
POL(LE(x1, x2)) = x2   
POL(MINUS(x1, x2)) = [2]x2 + [2]x1·x2   
POL(c6(x1)) = x1   
POL(c7(x1)) = x1   
POL(c7(x1, x2)) = x1 + x2   
POL(c9(x1)) = x1   
POL(false) = 0   
POL(le(x1, x2)) = 0   
POL(s(x1)) = [2] + x1   
POL(true) = 0   

(22) Obligation:

Complexity Dependency Tuples Problem
Rules:

p(0) → s(s(0))
p(s(z0)) → z0
p(p(s(z0))) → p(z0)
le(p(s(z0)), z0) → le(z0, z0)
le(0, z0) → true
le(s(z0), 0) → false
le(s(z0), s(z1)) → le(z0, z1)
minus(z0, z1) → if(le(z0, z1), z0, z1)
if(true, z0, z1) → 0
if(false, z0, z1) → s(minus(p(z0), z1))
Tuples:

LE(s(z0), s(z1)) → c6(LE(z0, z1))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
IF(false, s(z0), x1) → c9(MINUS(z0, x1))
S tuples:none
K tuples:

IF(false, s(z0), x1) → c9(MINUS(z0, x1))
MINUS(s(z0), s(z1)) → c7(IF(le(z0, z1), s(z0), s(z1)), LE(s(z0), s(z1)))
MINUS(s(z0), 0) → c7(IF(false, s(z0), 0))
LE(s(z0), s(z1)) → c6(LE(z0, z1))
Defined Rule Symbols:

p, le, minus, if

Defined Pair Symbols:

LE, MINUS, IF

Compound Symbols:

c6, c7, c7, c9

(23) SIsEmptyProof (EQUIVALENT transformation)

The set S is empty

(24) BOUNDS(O(1), O(1))